/*
 * SonarQube
 * Copyright (C) 2009-2017 SonarSource SA
 * mailto:info AT sonarsource DOT com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
@import (reference) "mixins";
@import (reference) "variables";

@imagesPath: '../images/select2.png';
@imagesPath2x: '../images/select2x2.png';
@spinnerPath: '../images/loading.gif';

.select2-container {
  vertical-align: middle;
}

.select2-container .select2-choice {
  height: @formControlHeight;
  line-height: @formControlHeight - 2px;
  border-color: @darkGrey;
  border-radius: 2px;
  box-sizing: border-box;
  background: #fff;
  font-size: 12px;
  text-align: left;
}

.select2-container .select2-choice,
.select2-container .select2-choices {
  transition: border-color 0.2s ease;
}

.select2-container .select2-choice abbr {
  top: 4px;
}

.select2-container .select2-choice div {
  width: 19px;
  border: none;
  border-radius: 0;
  background: #fff;
}

.select2-container .select2-choice div b {
  top: 4px;
  background-position: 1px -1px;
}

.select2-dropdown-open .select2-choice div b {
  background-position: -17px -1px;
}

.select2-container .select2-choice span i {
  position: relative;
  top: 2px;
}

.select2-container-active .select2-choice,
.select2-container-active .select2-choices {
  border-color: @highlighted;
  box-shadow: none;
}

.select2-dropdown-open .select2-choice {
  box-shadow: none;
}

.select2-drop {
  z-index: @select2-drop-z-index;
  border-color: @darkGrey;
  border-radius: 0;
}

.select2-drop-active {
  border-color: @highlighted;
}

.select2-dropdown-open.select2-drop-above .select2-choice,
.select2-dropdown-open.select2-drop-above .select2-choices {
  border-color: @highlighted;
  border-radius: 0;
  background: #fff;
}

.select2-drop.select2-drop-above.select2-drop-active {
  border-color: @highlighted;
  border-radius: 0;
}

.select2-drop.select2-drop-above .select2-search input {
  margin-top: 0;
}

.select2-results {
  margin: 0;
  padding: 5px 0;
  border-top: 1px solid @darkGrey;
}

.select2-results .select2-result-label {
  height: 20px;
  line-height: 20px;
  padding: 0 8px;
  color: @baseFontColor;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select2-results .select2-no-results,
.select2-results .select2-searching,
.select2-results .select2-selection-limit,
.select2-more-results.select2-active {
  height: 20px;
  line-height: 20px;
  padding: 0 10px;
}

.select2-results .select2-highlighted {
  background: transparent;
  color: @baseFontColor;
}

.select2-results .select2-highlighted .select2-result-label {
  background: darken(@grey, 5%);
}

.select2-search {
  padding: 4px;
}

.select2-search input {
  height: 20px;
  padding: 0 7px;
  border-color: @darkGrey;
  background: #fff !important;
}

.select2-container-multi .select2-choices {
  min-height: 19px;
  padding-bottom: 1px;
  border-color: @darkGrey;
  background: #fff;
}

.select2-container-multi.select2-container-active .select2-choices {
  border-color: @highlighted;
  box-shadow: none;
}

.select2-container-multi .select2-choices .select2-search-field input {
  height: 16px;
  padding: 0 3px;
}

.select2-container-multi .select2-choices .select2-search-choice {
  margin: 1px 1px 0 1px;
  padding: 1px 5px 2px 18px;
  border-radius: 0;
  border-color: @darkGrey;
  background: @grey;
  box-shadow: none;
}

.select2-search-choice-close {
  top: 2px;
}

.select2-search-choice-close,
.select2-container .select2-choice abbr,
.select2-container .select2-choice div b {
  background-image: url(@imagesPath2x);
  background-size: 60px 40px;
}

.select2-search input.select2-active,
.select2-more-results.select2-active,
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
  background-image: url(@spinnerPath);
}

.select2-offscreen {
  left: 0;
  top: -100000px;
}




